Clients may pass not `NULL`-terminated strings as the function takes a
`len` argument. Use that argument.
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
g_free (context_wayland->surrounding.text);
- context_wayland->surrounding.text = g_strdup (text);
+ context_wayland->surrounding.text = g_strndup (text, len);
context_wayland->surrounding.cursor_idx = cursor_index;
/* Anchor is not exposed via the set_surrounding interface, emulating. */
context_wayland->surrounding.anchor_idx = cursor_index;